﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="OwnerList.aspx.cs" Inherits="ListOwner" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CPH_head" runat="Server">
    <style>
        .modal-body
        {
            max-height:none;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CPH_BreadCrumbs" runat="Server">
    <ul class="breadcrumb">
        <li><i class="icon-home home-icon"></i><a href="./default.aspx">首页</a> <span class="divider">
            <i class="icon-angle-right arrow-icon"></i></span></li>
        <li><a href="#">户主管理</a> <span class="divider">
            <i class="icon-angle-right arrow-icon"></i></span></li>
        <li><a href="#">户主列表</a> </li>
    </ul>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="CPH_Content" runat="Server">
    <div class="row-fluid">
        <%--<h3 class="header smaller lighter blue">
            jQuery dataTables</h3>--%>
        <div class="table-header">
            户主列表
        </div>
        <div id="sample-table-2_wrapper" class="dataTables_wrapper" role="grid">
            <table id="sample-table-2" class="table table-striped table-bordered table-hover dataTable"
                aria-describedby="sample-table-2_info">
                <thead>
                    <tr role="row">
                        <th class="center sorting_disabled" role="columnheader" rowspan="1" colspan="1" aria-label="" style="width: 61px;">
                            <label>
                                <input type="checkbox">
                                <span class="lbl"></span>
                            </label>
                        </th>
                        <th class="sorting" role="columnheader" tabindex="0" aria-controls="sample-table-2"
                            rowspan="1" colspan="1" aria-label="Domain: activate to sort column ascending"
                            style="width: 179px;">
                            协议编号
                        </th>
                        <th class="sorting" role="columnheader" tabindex="0" aria-controls="sample-table-2"
                            rowspan="1" colspan="1" aria-label="Price: activate to sort column ascending"
                            style="width: 134px;">
                            户主姓名
                        </th>
                        <th class="hidden-480 sorting" role="columnheader" tabindex="0" aria-controls="sample-table-2"
                            rowspan="1" colspan="1" aria-label="Clicks: activate to sort column ascending"
                            style="width: 143px;">
                            所属行政村
                        </th>
                        <th class="hidden-phone sorting" role="columnheader" tabindex="0" aria-controls="sample-table-2"
                            rowspan="1" colspan="1" aria-label="Update	: activate to sort column ascending" style="width: 208px;">
                            身份证号
                        </th>
                        <th class="hidden-480 sorting" role="columnheader" tabindex="0" aria-controls="sample-table-2"
                            rowspan="1" colspan="1" aria-label="Status: activate to sort column ascending"
                            style="width: 189px;">
                            联系方式
                        </th>
                        <th class="hidden-480 sorting" role="columnheader" tabindex="0" aria-controls="sample-table-2"
                            rowspan="1" colspan="1" aria-label="Status: activate to sort column ascending"
                            style="width: 189px;">
                            安置人口
                        </th>
                        <th class="hidden-480 sorting" role="columnheader" tabindex="0" aria-controls="sample-table-2"
                            rowspan="1" colspan="1" aria-label="Status: activate to sort column ascending"
                            style="width: 189px;">
                            协议类型
                        </th>
                        <th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" aria-label=""
                            style="width: 159px;">
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td class="center">
                            <label>
                                <input type="checkbox" />
                                <span class="lbl"></span>
                            </label>
                        </td>
                        <td>
                            <a href="#">DY131001</a>
                        </td>
                        <td>
                            张三
                        </td>
                        <td class="hidden-480">
                            大洋
                        </td>
                        <td class="hidden-phone">
                            330126196812232314
                        </td>
                        <td class="hidden-480">
                            13567891234
                        </td>
                        <td class="hidden-480">
                            4
                        </td>
                        <td class="hidden-480">
                            立项户
                        </td>
                        <td class="td-actions">
                            <div class="hidden-phone visible-desktop action-buttons">
                                <a class="blue" href="#"><i class="icon-zoom-in bigger-130"></i></a><a class="green"
                                    href="#"><i class="icon-pencil bigger-130"></i></a><a class="red" href="#"><i class="icon-trash bigger-130">
                                    </i></a>
                            </div>
                            <div class="hidden-desktop visible-phone">
                                <div class="inline position-relative">
                                    <button class="btn btn-minier btn-yellow dropdown-toggle" data-toggle="dropdown">
                                        <i class="icon-caret-down icon-only bigger-120"></i>
                                    </button>
                                    <ul class="dropdown-menu dropdown-icon-only dropdown-yellow pull-right dropdown-caret dropdown-close">
                                        <li><a href="#" class="tooltip-info" data-rel="tooltip" title="View"><span class="blue">
                                            <i class="icon-zoom-in bigger-120"></i></span></a></li>
                                        <li><a href="#" class="tooltip-success" data-rel="tooltip" title="Edit"><span class="green">
                                            <i class="icon-edit bigger-120"></i></span></a></li>
                                        <li><a href="#" class="tooltip-error" data-rel="tooltip" title="Delete"><span class="red">
                                            <i class="icon-trash bigger-120"></i></span></a></li>
                                    </ul>
                                </div>
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>


    <div id="modal-table" class="modal hide fade" tabindex="-1">
        <div class="modal-header no-padding">
            <div class="table-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                信息概览
            </div>
        </div>

        <div class="modal-body no-padding">
            <div class="row-fluid">
                <iframe id="ViewInfo" style="border:0;padding:0;margin:0;background:#fff;width:100%;height:400px"></iframe>
            </div>
        </div>

        <div class="modal-footer">
            <button class="btn btn-small btn-danger pull-right" data-dismiss="modal">
                <i class="icon-remove"></i>
                关闭
            </button>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="CPH_Foot" runat="Server">
    <script>
        $(document).ready(function () {
            //            $('#sample-table-2').dataTable({
            //                "aoColumns": [
            //			      { "bSortable": false },
            //			      null, null, null, null, null,
            //				  { "bSortable": false }
            //				]
            //            });
            var oTable = $('#sample-table-2').dataTable({

                //"sAjaxSource": msg,
                //"aoColumns": msg.aoColumns,
                //"aaData": msg.aaData,

                "oLanguage": {
                    "sLengthMenu": "每页_MENU_条",
                    "sZeroRecords": "没有记录",
                    "sInfo": "当前第_START_-_END_条/共_TOTAL_条",
                    "sInfoEmpty": " 0-0/共0条",
                    "sInfoFiltered": "(共搜索 _MAX_ 条)",
                    //"sPagePrevious": "上一页",
                    "sSearch": "快速搜索:"
                }

            });
            $.ajax({
                url: "./Controls/ajax.aspx?op=ListOwner",
                //data: { "t": "e" },
                //cache: false,
                success: function (msg) {
                    oTable.fnDestroy();
                    ReLoadDataTable(); //修复IE8下重新加载就出现列不对齐的BUG
                    //$("#tableSample thead tr").html(msg.head);
                    //alert(msg.cont);
                    var count = msg.headCount;
                    var str = "";
                    for (var i = 0; i < count; i++) {
                        str += "<th></th>";
                    }
                    $('#sample-table-2 thead tr').html(str);
                    //alert(msg);
                    oTable = $('#sample-table-2').dataTable({
                        
                        "sAjaxSource": msg,
                        "aoColumns": msg.aoColumns,
                        "aaData": msg.aaData,

                        "oLanguage": {
                            "sLengthMenu": "每页_MENU_条",
                            "sZeroRecords": "没有记录",
                            "sInfo": "当前第_START_-_END_条/共_TOTAL_条",
                            "sInfoEmpty": " 0-0/共0条",
                            "sInfoFiltered": "(共搜索 _MAX_ 条)",
                            //"sPagePrevious": "上一页",
                            "sSearch": "快速搜索:"
                        }

                    });

                }
            });
            
            $('table th input:checkbox').on('click', function () {
                var that = this;
                $(this).closest('table').find('tr > td:first-child input:checkbox')
					.each(function () {
					    this.checked = that.checked;
					    $(this).closest('tr').toggleClass('selected');
					});

            });
        });
        function DeleteInfo(cardId, procId) {
            if (confirm('确定删除？')) {
                $.ajax({
                    url: './Controls/ajax.aspx?op=DeleteOwnerAndProc',
                    data: { 'cardId': cardId,'procId':procId },
                    success: function (res) {
                        $("#" + cardId).hide();
                    }
                })
            }
        }
        function ViewInfo(cardId, procId) {
            $("#ViewInfo").attr("src", "OwnerView.aspx?procId=" + procId);
            //$("#modal-table").modal({"backdrop":false});
            $("#modal-table").modal("show");
        }
        function EditInfo(cardId, procId) {
        }
        function ReLoadDataTable() {
            $("#tableSample").html('<thead><tr><th>文件名</th><th>大小</th><th>修改时间</th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody></tbody>')
        }
    </script>
</asp:Content>
